package com.bohua.intermediary.controller;

import com.bohua.intermediary.common.Lay;
import com.bohua.intermediary.common.Msg;
import com.bohua.intermediary.entity.SysLog;
import com.bohua.intermediary.service.SysLogService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
/**
 * 控制器
 * @author qian
 * @email 1415261159@qq.com
 * @date 2019/01/19
 */
@Controller
@RequestMapping("/sysLog")
public class SysLogController {
    @Resource
    private SysLogService sysLogService;

    @RequestMapping
    public String sysLog(){
        return "sysLog/sysLog";
    }
    @RequestMapping("/add")
    public String add(){
        return "sysLog/addSysLog";
    }

    @RequestMapping("/update")
    public String update(){
        return "sysLog/updateSysLog";
    }

    @RequestMapping("/getSysLogs")
    @ResponseBody
    public Lay getSysLogs(SysLog sysLog,Integer page,Integer limit){
        return sysLogService.getSysLogs(sysLog,page,limit);
    }
    @RequestMapping("/addSysLog")
    @ResponseBody
    public Msg addSysLog(SysLog sysLog){
        return sysLogService.addSysLog(sysLog);
    }

    @RequestMapping("/updateSysLog")
    @ResponseBody
    public Msg updateSysLog(SysLog sysLog){
        return sysLogService.updateSysLog(sysLog);
    }

    @RequestMapping("/delSysLog")
    @ResponseBody
    public Msg delSysLog(SysLog sysLog){
        return sysLogService.delSysLog(sysLog);
    }
}
